﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SSHaltAction : SSAction {
    protected SSHaltAction() {}

    protected float countdown;

    public void Init(float duration, int identifier = 0, ISSActionCallback callback = null) {
        base.Init(identifier, callback);
        this.countdown = duration;
    }

    public static SSHaltAction GetSSAction() {
        SSHaltAction action = ScriptableObject.CreateInstance<SSHaltAction>();
        return action;
    }

    public override void Update() {
        countdown -= Time.deltaTime;
        if (countdown <= 0.0f) {
            SetOver(true);
            SendCompleteEvent();
        }
    }
}
